/*
 * File: carrary.c
 *
 * Code generated for Simulink model 'carrary'.
 *
 * Model version                  : 1.2
 * Simulink Coder version         : 9.0 (R2018b) 24-May-2018
 * C/C++ source code generated on : Sun May 16 00:50:06 2021
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: ARM Compatible->ARM Cortex
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#include "carrary.h"
#include "carrary_private.h"

/* Block states (default storage) */
DW_carrary_T carrary_DW;

/* External outputs (root outports fed by signals with default storage) */
ExtY_carrary_T carrary_Y;

/* Real-time model */
RT_MODEL_carrary_T carrary_M_;
RT_MODEL_carrary_T *const carrary_M = &carrary_M_;

/* Model step function */
void carrary_step(void)
{
  /* local block i/o variables */
  real_T rtb_FromWorkspace[199];

  /* FromWorkspace: '<Root>/From Workspace' */
  {
    real_T *pDataValues = (real_T *) carrary_DW.FromWorkspace_PWORK.DataPtr;

    {
      int_T elIdx;
      for (elIdx = 0; elIdx < 199; ++elIdx) {
        (&rtb_FromWorkspace[0])[elIdx] = pDataValues[0];
        pDataValues += 1;
      }
    }
  }

  /* Outport: '<Root>/Out1' */
  memcpy(&carrary_Y.Out1[0], &rtb_FromWorkspace[0], 199U * sizeof(real_T));

  /* Update absolute time for base rate */
  /* The "clockTick0" counts the number of times the code of this task has
   * been executed. The absolute time is the multiplication of "clockTick0"
   * and "Timing.stepSize0". Size of "clockTick0" ensures timer will not
   * overflow during the application lifespan selected.
   */
  carrary_M->Timing.t[0] =
    (++carrary_M->Timing.clockTick0) * carrary_M->Timing.stepSize0;
}

/* Model initialize function */
void carrary_initialize(void)
{
  /* Registration code */

  /* initialize real-time model */
  (void) memset((void *)carrary_M, 0,
                sizeof(RT_MODEL_carrary_T));

  {
    /* Setup solver object */
    rtsiSetSimTimeStepPtr(&carrary_M->solverInfo, &carrary_M->Timing.simTimeStep);
    rtsiSetTPtr(&carrary_M->solverInfo, &rtmGetTPtr(carrary_M));
    rtsiSetStepSizePtr(&carrary_M->solverInfo, &carrary_M->Timing.stepSize0);
    rtsiSetErrorStatusPtr(&carrary_M->solverInfo, ((const char_T **)
      (&rtmGetErrorStatus(carrary_M))));
    rtsiSetRTModelPtr(&carrary_M->solverInfo, carrary_M);
  }

  rtsiSetSimTimeStep(&carrary_M->solverInfo, MAJOR_TIME_STEP);
  rtsiSetSolverName(&carrary_M->solverInfo,"FixedStepDiscrete");
  rtmSetTPtr(carrary_M, &carrary_M->Timing.tArray[0]);
  carrary_M->Timing.stepSize0 = 0.2;

  /* states (dwork) */
  (void) memset((void *)&carrary_DW, 0,
                sizeof(DW_carrary_T));

  /* external outputs */
  (void) memset(&carrary_Y.Out1[0], 0,
                199U*sizeof(real_T));

  /* Start for FromWorkspace: '<Root>/From Workspace' */
  {
    static real_T pTimeValues0[] = { 5181.0 } ;

    static real_T pDataValues0[] = { 5200.0, 5177.0, 5194.0, 5164.0, 5125.0,
      5131.0, 5144.0, 5135.0, 5131.0, 5135.0, 5231.0, 5226.0, 5221.0, 5129.0,
      5125.0, 5133.0, 5013.0, 5016.0, 5134.0, 5152.0, 5151.0, 5152.0, 5137.0,
      5142.0, 5126.0, 5129.0, 5138.0, 5114.0, 5114.0, 5115.0, 5131.0, 5126.0,
      5120.0, 5112.0, 5137.0, 5122.0, 5129.0, 5170.0, 5185.0, 5183.0, 5174.0,
      5185.0, 5164.0, 5126.0, 5021.0, 5017.0, 5234.0, 5120.0, 5145.0, 5263.0,
      5273.0, 5157.0, 5130.0, 5127.0, 5136.0, 5022.0, 5033.0, 5024.0, 5045.0,
      5081.0, 5169.0, 5201.0, 5195.0, 5203.0, 5185.0, 5173.0, 5158.0, 5146.0,
      5151.0, 5168.0, 5168.0, 5150.0, 5131.0, 5145.0, 5141.0, 5129.0, 5150.0,
      5180.0, 5185.0, 5170.0, 5172.0, 5190.0, 5161.0, 5031.0, 5053.0, 5129.0,
      5049.0, 5059.0, 5015.0, 5019.0, 5004.0, 4909.0, 5093.0, 5113.0, 5129.0,
      5141.0, 5119.0, 5147.0, 5147.0, 5147.0, 5137.0, 5102.0, 5089.0, 5106.0,
      5112.0, 5114.0, 5090.0, 5072.0, 5086.0, 5093.0, 5105.0, 4974.0, 5109.0,
      5090.0, 5095.0, 5115.0, 5130.0, 5134.0, 5148.0, 5026.0, 5049.0, 5056.0,
      5034.0, 5065.0, 5077.0, 5155.0, 5154.0, 5069.0, 5065.0, 5045.0, 5158.0,
      5158.0, 5138.0, 5178.0, 5163.0, 5146.0, 5140.0, 5155.0, 5171.0, 5157.0,
      5107.0, 5127.0, 5135.0, 5125.0, 5118.0, 5127.0, 5161.0, 5164.0, 5153.0,
      5117.0, 5114.0, 5108.0, 5099.0, 5132.0, 5075.0, 5089.0, 5108.0, 5113.0,
      5136.0, 5031.0, 5053.0, 5164.0, 5185.0, 5079.0, 5088.0, 5071.0, 5076.0,
      5093.0, 5088.0, 5074.0, 5064.0, 5079.0, 5080.0, 5177.0, 5178.0, 5192.0,
      5171.0, 5137.0, 5116.0, 5106.0, 5140.0, 5166.0, 5143.0, 5143.0, 5112.0,
      5132.0, 5134.0, 5127.0, 5112.0, 5122.0, 5118.0, 5131.0, 5155.0, 5165.0,
      5147.0, 5159.0, 5122.0, 5122.0, 5034.0 } ;

    carrary_DW.FromWorkspace_PWORK.TimePtr = (void *) pTimeValues0;
    carrary_DW.FromWorkspace_PWORK.DataPtr = (void *) pDataValues0;
    carrary_DW.FromWorkspace_IWORK.PrevIndex = 0;
  }
}

/* Model terminate function */
void carrary_terminate(void)
{
  /* (no terminate code required) */
}

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
